class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: E = None
        self.o: F = None
        self.r: A = None
        self.x: B = None
        self.t: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: C = None
        self.o: B = None
        self.s: D = None
        self.x: B = None
        self.u: A = None
        self.txt = txt

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

k = A("k")
g = B("g")
n = C("n")
f = D("f")
m = E("m")
b = F("b")
c = B("c")
a = A("a")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: C = None
        self.o: B = None
        self.s: D = None
        self.x: B = None
        self.u: A = None
        self.txt = txt

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

k = A("k")
g = B("g")
n = C("n")
f = D("f")
m = E("m")
b = F("b")
c = B("c")
a = A("a")

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