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

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

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

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

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

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

k = A("k")
b = B("b")
d = C("d")
n = D("n")
c = E("c")
a = F("a")

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

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

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

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

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

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

k = A("k")
b = B("b")
d = C("d")
n = D("n")
c = E("c")
a = F("a")

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