class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: D = None
        self.s: D = None
        self.v: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.x: A = None
        self.z: C = None
        self.t: D = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.x: A = None
        self.z: C = None
        self.t: D = None
        self.s: A = None
        self.txt = txt

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

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

n.o = h
n.r = l
n.s = c
n.v = j
h.x = b
h.y = f
b.x = j
b.z = c
l.o = n
l.r = f
l.x = c
f.w = l
f.t = l
f.u = e
f.x = n
f.s = n
f.z = j
e.p = b
e.s = j
e.u = c
j.x = b
j.z = l
c.o = n
c.r = f
c.x = l
assert h.x.x.z.txt == "l"