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

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

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

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

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

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

h = A("h")
f = B("f")
b = C("b")
j = D("j")
e = E("e")
a = F("a")

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

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

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

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

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

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

h = A("h")
f = B("f")
b = C("b")
j = D("j")
e = E("e")
a = F("a")

h.t = e
h.x = e
f.v = h
f.z = h
f.t = e
b.x = h
b.y = f
b.z = e
b.p = j
j.q = b
j.o = b
j.z = f
j.y = f
e.o = f
e.r = f
a.p = b
a.y = f
a.v = f
a.t = j
a.w = j
a.r = e
assert j.y.v.x.r.z.x.txt == "e"