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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: E = None
        self.s: F = None
        self.u: F = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: A = None
        self.r: E = None
        self.u: E = None
        self.t: C = None
        self.txt = txt

i = A("i")
c = B("c")
d = C("d")
l = D("l")
f = E("f")
a = F("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: E = None
        self.s: F = None
        self.u: F = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: A = None
        self.r: E = None
        self.u: E = None
        self.t: C = None
        self.txt = txt

i = A("i")
c = B("c")
d = C("d")
l = D("l")
f = E("f")
a = F("a")

i.o = l
i.y = l
i.r = f
c.w = d
d.z = l
d.u = c
l.x = i
l.z = f
l.s = a
l.u = a
l.t = d
f.q = a
f.r = a
a.p = l
a.s = i
a.r = f
a.u = f
a.t = d
assert l.u.p.t.z.x.o.txt == "l"