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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: B = None
        self.u: E = None
        self.x: F = None
        self.q: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.y: A = None
        self.p: C = None
        self.txt = txt

n = A("n")
j = B("j")
c = C("c")
e = D("e")
a = E("a")
l = F("l")
b = A("b")
d = F("d")
f = B("f")
m = B("m")

n.v = e
j.o = l
c.o = a
c.u = a
c.y = m
c.x = d
c.q = d
e.v = c
e.q = l
e.t = l
a.w = n
a.o = n
l.z = j
l.r = c
l.p = c
l.y = b
b.v = e
d.z = f
d.r = c
d.p = c
d.y = n
f.o = l
m.o = l
assert d.z.o.z.o.z.o.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: B = None
        self.u: E = None
        self.x: F = None
        self.q: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.y: A = None
        self.p: C = None
        self.txt = txt

n = A("n")
j = B("j")
c = C("c")
e = D("e")
a = E("a")
l = F("l")
b = A("b")
d = F("d")
f = B("f")
m = B("m")

n.v = e
j.o = l
c.o = a
c.u = a
c.y = m
c.x = d
c.q = d
e.v = c
e.q = l
e.t = l
a.w = n
a.o = n
l.z = j
l.r = c
l.p = c
l.y = b
b.v = e
d.z = f
d.r = c
d.p = c
d.y = n
f.o = l
m.o = l
assert d.z.o.z.o.z.o.r.u.txt == "a"