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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: D = None
        self.o: D = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: D = None
        self.o: D = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

f.o = l
f.y = b
f.r = b
f.t = h
h.v = i
h.z = i
h.x = b
h.u = b
h.q = f
i.q = d
b.x = l
b.o = h
l.w = c
l.t = b
l.o = b
l.y = b
d.p = i
n.v = i
n.z = i
n.x = b
n.u = b
n.q = c
c.o = l
c.y = b
c.r = b
c.t = h
m.v = i
m.z = i
m.x = b
m.u = b
m.q = f
assert m.u.x.y.x.txt == "l"