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

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

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

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

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

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

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

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

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

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

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

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

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

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

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