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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: A = None
        self.t: E = None
        self.o: F = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: A = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: E = None
        self.v: F = None
        self.t: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: A = None
        self.t: E = None
        self.o: F = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: A = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: E = None
        self.v: F = None
        self.t: E = None
        self.txt = txt

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

j.p = f
j.o = f
j.s = c
j.w = n
n.o = f
n.w = f
n.r = h
n.u = b
b.x = k
b.t = k
b.p = j
b.z = j
b.o = g
h.y = g
k.r = g
k.t = e
k.o = e
c.s = g
c.v = g
c.x = k
c.t = k
f.o = n
f.w = n
f.r = h
f.u = b
g.s = a
g.x = k
g.t = k
g.v = c
e.p = n
e.o = n
e.w = n
e.s = c
a.s = g
a.x = k
a.t = k
a.v = c
assert j.s.s.x.txt == "k"