class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: B = None
        self.r: E = None
        self.o: B = None
        self.p: B = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: F = None
        self.w: A = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: A = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: F = None
        self.y: A = None
        self.t: E = None
        self.txt = txt

i = A("i")
g = B("g")
k = C("k")
n = D("n")
b = E("b")
c = F("c")
e = F("e")

i.t = b
i.r = b
i.u = g
i.o = g
i.p = g
i.s = k
g.v = k
g.y = n
k.w = g
k.z = c
n.u = i
n.w = i
n.q = c
n.r = c
b.p = n
b.w = n
b.r = i
c.o = k
c.p = e
c.y = i
c.t = b
e.o = k
e.p = c
e.y = i
e.t = b
assert k.z.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: B = None
        self.r: E = None
        self.o: B = None
        self.p: B = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: F = None
        self.w: A = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: A = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: F = None
        self.y: A = None
        self.t: E = None
        self.txt = txt

i = A("i")
g = B("g")
k = C("k")
n = D("n")
b = E("b")
c = F("c")
e = F("e")

i.t = b
i.r = b
i.u = g
i.o = g
i.p = g
i.s = k
g.v = k
g.y = n
k.w = g
k.z = c
n.u = i
n.w = i
n.q = c
n.r = c
b.p = n
b.w = n
b.r = i
c.o = k
c.p = e
c.y = i
c.t = b
e.o = k
e.p = c
e.y = i
e.t = b
assert k.z.o.w.txt == "g"