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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: E = None
        self.o: E = None
        self.v: B = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: C = None
        self.t: C = None
        self.s: F = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: B = None
        self.w: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: E = None
        self.o: E = None
        self.v: B = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: C = None
        self.t: C = None
        self.s: F = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: B = None
        self.w: F = None
        self.txt = txt

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

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

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