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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: F = None
        self.u: F = None
        self.w: F = None
        self.txt = txt

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

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

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

d.y = e
d.o = e
d.z = e
d.x = a
d.u = h
d.p = h
e.w = f
h.v = j
h.r = d
h.u = e
h.y = k
h.o = k
a.x = k
a.o = k
a.u = k
a.w = k
f.p = d
k.x = a
k.v = h
j.v = h
j.r = d
j.u = e
j.y = k
j.o = k
assert e.w.p.o.w.p.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.x: D = None
        self.z: B = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: F = None
        self.u: F = None
        self.w: F = None
        self.txt = txt

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

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

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

d.y = e
d.o = e
d.z = e
d.x = a
d.u = h
d.p = h
e.w = f
h.v = j
h.r = d
h.u = e
h.y = k
h.o = k
a.x = k
a.o = k
a.u = k
a.w = k
f.p = d
k.x = a
k.v = h
j.v = h
j.r = d
j.u = e
j.y = k
j.o = k
assert e.w.p.o.w.p.p.u.txt == "e"