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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.s: D = None
        self.t: A = None
        self.txt = txt

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

n.u = l
n.o = l
n.s = k
c.v = n
h.o = l
f.p = h
k.v = f
k.p = f
k.w = n
k.s = h
k.z = l
l.v = c
l.q = c
l.s = f
l.t = n
b.v = c
b.q = c
b.s = f
b.t = n
assert l.t.s.s.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: F = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.s: D = None
        self.t: A = None
        self.txt = txt

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

n.u = l
n.o = l
n.s = k
c.v = n
h.o = l
f.p = h
k.v = f
k.p = f
k.w = n
k.s = h
k.z = l
l.v = c
l.q = c
l.s = f
l.t = n
b.v = c
b.q = c
b.s = f
b.t = n
assert l.t.s.s.o.q.txt == "c"