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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: D = None
        self.u: A = None
        self.s: E = None
        self.t: D = None
        self.y: C = None
        self.txt = txt

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

n = A("n")
d = B("d")
m = C("m")
j = D("j")
a = E("a")
b = F("b")
h = E("h")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: D = None
        self.u: A = None
        self.s: E = None
        self.t: D = None
        self.y: C = None
        self.txt = txt

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

n = A("n")
d = B("d")
m = C("m")
j = D("j")
a = E("a")
b = F("b")
h = E("h")

n.v = m
d.t = a
m.s = h
m.o = d
m.z = n
j.u = a
j.p = d
j.s = n
a.q = d
a.r = j
a.t = j
a.u = n
a.s = h
a.y = m
b.v = h
b.o = j
h.q = d
h.r = j
h.t = j
h.u = n
h.s = a
h.y = m
assert m.o.t.u.v.s.u.txt == "n"