class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: D = None
        self.q: E = None
        self.o: E = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: E = None
        self.y: A = None
        self.t: F = None
        self.v: E = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: B = None
        self.z: C = None
        self.txt = txt

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

l = A("l")
b = B("b")
d = C("d")
e = D("e")
h = E("h")
k = F("k")

l.y = k
l.p = e
l.q = h
l.o = h
l.x = h
b.v = l
b.o = l
b.y = k
d.q = l
d.u = l
d.y = e
e.w = l
e.y = l
e.q = h
e.v = h
e.t = k
e.x = k
h.y = l
h.o = b
h.z = d
k.v = d
k.z = l
assert k.z.q.y.p.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: D = None
        self.q: E = None
        self.o: E = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: E = None
        self.y: A = None
        self.t: F = None
        self.v: E = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: B = None
        self.z: C = None
        self.txt = txt

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

l = A("l")
b = B("b")
d = C("d")
e = D("e")
h = E("h")
k = F("k")

l.y = k
l.p = e
l.q = h
l.o = h
l.x = h
b.v = l
b.o = l
b.y = k
d.q = l
d.u = l
d.y = e
e.w = l
e.y = l
e.q = h
e.v = h
e.t = k
e.x = k
h.y = l
h.o = b
h.z = d
k.v = d
k.z = l
assert k.z.q.y.p.q.z.txt == "d"