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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: A = None
        self.z: D = None
        self.txt = txt

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

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

d.o = b
d.v = m
d.y = e
b.q = d
b.z = d
b.x = k
a.x = d
a.s = m
a.p = m
l.z = k
e.q = b
e.r = d
e.z = l
m.q = b
m.u = a
m.z = l
m.v = l
m.y = d
k.x = d
k.s = m
k.p = m
assert b.q.y.q.z.y.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: F = None
        self.y: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: A = None
        self.z: D = None
        self.txt = txt

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

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

d.o = b
d.v = m
d.y = e
b.q = d
b.z = d
b.x = k
a.x = d
a.s = m
a.p = m
l.z = k
e.q = b
e.r = d
e.z = l
m.q = b
m.u = a
m.z = l
m.v = l
m.y = d
k.x = d
k.s = m
k.p = m
assert b.q.y.q.z.y.z.z.txt == "k"