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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: B = None
        self.u: B = None
        self.r: C = None
        self.p: E = None
        self.txt = txt

n = A("n")
j = B("j")
l = C("l")
m = D("m")
e = E("e")
h = F("h")
k = E("k")

n.r = l
n.z = m
n.v = m
n.p = j
n.q = h
j.o = k
j.x = l
l.u = j
m.u = h
m.y = l
e.p = k
e.z = k
e.x = l
e.q = l
e.s = h
h.y = l
h.r = l
h.v = j
h.u = j
h.p = e
k.p = e
k.z = e
k.x = l
k.q = l
k.s = h
assert l.u.x.u.x.u.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: D = None
        self.p: B = None
        self.v: D = None
        self.q: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: B = None
        self.u: B = None
        self.r: C = None
        self.p: E = None
        self.txt = txt

n = A("n")
j = B("j")
l = C("l")
m = D("m")
e = E("e")
h = F("h")
k = E("k")

n.r = l
n.z = m
n.v = m
n.p = j
n.q = h
j.o = k
j.x = l
l.u = j
m.u = h
m.y = l
e.p = k
e.z = k
e.x = l
e.q = l
e.s = h
h.y = l
h.r = l
h.v = j
h.u = j
h.p = e
k.p = e
k.z = e
k.x = l
k.q = l
k.s = h
assert l.u.x.u.x.u.o.s.txt == "h"