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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: A = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: D = None
        self.txt = txt

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

f.x = h
n.s = m
h.v = n
h.u = m
e.o = f
e.q = m
e.t = a
a.z = h
a.p = h
a.t = f
c.z = n
c.r = e
j.s = m
m.x = h
assert a.t.x.u.x.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: A = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: D = None
        self.txt = txt

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

f.x = h
n.s = m
h.v = n
h.u = m
e.o = f
e.q = m
e.t = a
a.z = h
a.p = h
a.t = f
c.z = n
c.r = e
j.s = m
m.x = h
assert a.t.x.u.x.u.x.txt == "h"