class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: D = None
        self.s: F = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: F = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: B = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

i = A("i")
l = B("l")
g = C("g")
e = D("e")
k = E("k")
n = F("n")
a = A("a")
m = E("m")

i.q = g
l.t = k
g.p = l
g.w = e
g.s = n
g.r = n
e.u = n
e.v = n
e.s = a
k.v = e
k.s = l
k.x = g
k.z = g
n.u = m
n.r = m
n.z = i
a.q = g
m.v = e
m.s = l
m.x = g
m.z = g
assert g.p.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: D = None
        self.s: F = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: F = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: B = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

i = A("i")
l = B("l")
g = C("g")
e = D("e")
k = E("k")
n = F("n")
a = A("a")
m = E("m")

i.q = g
l.t = k
g.p = l
g.w = e
g.s = n
g.r = n
e.u = n
e.v = n
e.s = a
k.v = e
k.s = l
k.x = g
k.z = g
n.u = m
n.r = m
n.z = i
a.q = g
m.v = e
m.s = l
m.x = g
m.z = g
assert g.p.t.s.txt == "l"