class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.r: C = None
        self.x: D = None
        self.y: B = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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