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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: D = None
        self.q: E = None
        self.z: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: D = None
        self.q: E = None
        self.z: E = None
        self.txt = txt

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

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