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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: D = None
        self.v: F = None
        self.x: B = None
        self.z: E = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: D = None
        self.v: F = None
        self.x: B = None
        self.z: E = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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