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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: C = None
        self.t: F = None
        self.r: E = None
        self.p: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: D = None
        self.p: B = None
        self.o: C = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: D = None
        self.y: C = None
        self.q: B = None
        self.v: D = None
        self.txt = txt

n = A("n")
g = B("g")
k = C("k")
b = D("b")
a = E("a")
j = F("j")

n.o = b
g.u = b
g.w = k
g.t = j
g.p = j
g.r = a
k.u = b
k.y = j
b.s = j
a.v = k
a.o = k
a.u = b
a.p = g
a.t = g
j.w = k
j.y = k
j.o = b
j.v = b
j.q = g
assert k.u.s.v.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: C = None
        self.t: F = None
        self.r: E = None
        self.p: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: D = None
        self.p: B = None
        self.o: C = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: D = None
        self.y: C = None
        self.q: B = None
        self.v: D = None
        self.txt = txt

n = A("n")
g = B("g")
k = C("k")
b = D("b")
a = E("a")
j = F("j")

n.o = b
g.u = b
g.w = k
g.t = j
g.p = j
g.r = a
k.u = b
k.y = j
b.s = j
a.v = k
a.o = k
a.u = b
a.p = g
a.t = g
j.w = k
j.y = k
j.o = b
j.v = b
j.q = g
assert k.u.s.v.s.o.txt == "b"