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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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