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

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

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

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

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

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

l = A("l")
i = B("i")
f = C("f")
d = D("d")
e = E("e")
h = F("h")

l.t = i
l.v = i
l.r = i
l.s = f
l.y = d
l.o = h
i.p = e
f.o = d
f.w = d
d.z = h
d.v = l
d.q = l
d.u = i
d.x = i
e.r = f
e.z = h
h.u = l
h.q = e
assert l.s.o.z.u.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: C = None
        self.y: D = None
        self.v: B = None
        self.o: F = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

l = A("l")
i = B("i")
f = C("f")
d = D("d")
e = E("e")
h = F("h")

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