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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: F = None
        self.v: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: D = None
        self.x: B = None
        self.z: C = None
        self.u: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.q: D = None
        self.x: B = None
        self.z: B = None
        self.y: B = None
        self.txt = txt

c = A("c")
h = B("h")
j = C("j")
i = D("i")
k = E("k")
b = F("b")
d = C("d")
m = C("m")
a = E("a")
f = A("f")

c.w = h
c.r = h
c.q = b
c.p = f
c.t = i
h.t = f
j.w = a
j.s = b
j.v = m
i.x = f
i.w = j
k.q = j
k.y = i
k.x = h
k.z = d
k.u = a
b.o = i
b.v = i
b.q = i
b.x = h
b.z = h
b.y = h
d.w = k
d.s = b
d.v = j
m.w = a
m.s = b
m.v = d
a.q = d
a.y = i
a.x = h
a.z = m
a.u = k
f.w = h
f.r = h
f.q = b
f.p = c
f.t = i
assert h.t.q.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: F = None
        self.p: A = None
        self.r: B = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: F = None
        self.v: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: D = None
        self.x: B = None
        self.z: C = None
        self.u: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.q: D = None
        self.x: B = None
        self.z: B = None
        self.y: B = None
        self.txt = txt

c = A("c")
h = B("h")
j = C("j")
i = D("i")
k = E("k")
b = F("b")
d = C("d")
m = C("m")
a = E("a")
f = A("f")

c.w = h
c.r = h
c.q = b
c.p = f
c.t = i
h.t = f
j.w = a
j.s = b
j.v = m
i.x = f
i.w = j
k.q = j
k.y = i
k.x = h
k.z = d
k.u = a
b.o = i
b.v = i
b.q = i
b.x = h
b.z = h
b.y = h
d.w = k
d.s = b
d.v = j
m.w = a
m.s = b
m.v = d
a.q = d
a.y = i
a.x = h
a.z = m
a.u = k
f.w = h
f.r = h
f.q = b
f.p = c
f.t = i
assert h.t.q.z.t.txt == "f"