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

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

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

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

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

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

n = A("n")
a = B("a")
b = C("b")
i = D("i")
h = E("h")
k = F("k")
f = D("f")
c = C("c")
g = E("g")

n.o = a
a.u = b
a.r = c
b.v = i
b.o = i
b.u = i
b.z = c
i.t = h
i.w = f
i.u = f
i.x = b
i.s = c
h.p = a
k.o = g
f.t = h
f.w = i
f.u = i
f.x = b
f.s = c
c.v = i
c.z = b
c.o = f
c.u = f
g.p = a
assert c.v.x.u.t.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

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

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

n = A("n")
a = B("a")
b = C("b")
i = D("i")
h = E("h")
k = F("k")
f = D("f")
c = C("c")
g = E("g")

n.o = a
a.u = b
a.r = c
b.v = i
b.o = i
b.u = i
b.z = c
i.t = h
i.w = f
i.u = f
i.x = b
i.s = c
h.p = a
k.o = g
f.t = h
f.w = i
f.u = i
f.x = b
f.s = c
c.v = i
c.z = b
c.o = f
c.u = f
g.p = a
assert c.v.x.u.t.p.u.txt == "b"