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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.y: A = None
        self.s: D = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

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

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

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

j = A("j")
e = B("e")
b = C("b")
a = D("a")
h = E("h")
g = F("g")
k = D("k")
c = F("c")
l = D("l")
f = D("f")

j.v = b
j.u = g
j.q = c
e.p = a
b.z = h
b.v = a
b.y = j
b.x = j
b.s = f
b.p = k
a.o = j
h.u = j
h.y = j
h.z = e
g.o = j
k.o = j
c.o = j
l.o = j
f.o = j
assert a.o.u.o.u.o.u.o.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: F = None
        self.q: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.y: A = None
        self.s: D = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

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

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

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

j = A("j")
e = B("e")
b = C("b")
a = D("a")
h = E("h")
g = F("g")
k = D("k")
c = F("c")
l = D("l")
f = D("f")

j.v = b
j.u = g
j.q = c
e.p = a
b.z = h
b.v = a
b.y = j
b.x = j
b.s = f
b.p = k
a.o = j
h.u = j
h.y = j
h.z = e
g.o = j
k.o = j
c.o = j
l.o = j
f.o = j
assert a.o.u.o.u.o.u.o.u.o.txt == "j"