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

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

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

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

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

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

i = A("i")
l = B("l")
m = C("m")
a = D("a")
f = E("f")
e = F("e")
h = C("h")
c = A("c")

i.z = f
l.t = a
l.v = i
m.t = a
m.w = c
m.u = f
m.q = f
m.r = l
m.x = h
a.v = c
a.w = h
a.y = l
a.u = e
f.z = e
f.w = c
e.v = f
e.x = a
e.r = i
e.s = i
h.t = a
h.w = c
h.u = f
h.q = f
h.r = l
h.x = m
c.z = f
assert i.z.w.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

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

i = A("i")
l = B("l")
m = C("m")
a = D("a")
f = E("f")
e = F("e")
h = C("h")
c = A("c")

i.z = f
l.t = a
l.v = i
m.t = a
m.w = c
m.u = f
m.q = f
m.r = l
m.x = h
a.v = c
a.w = h
a.y = l
a.u = e
f.z = e
f.w = c
e.v = f
e.x = a
e.r = i
e.s = i
h.t = a
h.w = c
h.u = f
h.q = f
h.r = l
h.x = m
c.z = f
assert i.z.w.z.z.txt == "e"