class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: B = None
        self.x: G = None
        self.u: B = None
        self.t: G = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: F = None
        self.y: G = None
        self.q: A = None
        self.z: C = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: G = None
        self.v: C = None
        self.y: E = None
        self.txt = txt

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

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

g = A("g")
a = B("a")
k = C("k")
l = D("l")
c = E("c")
e = F("e")
j = G("j")
n = E("n")

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: F = None
        self.y: G = None
        self.q: A = None
        self.z: C = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: G = None
        self.v: C = None
        self.y: E = None
        self.txt = txt

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

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

g = A("g")
a = B("a")
k = C("k")
l = D("l")
c = E("c")
e = F("e")
j = G("j")
n = E("n")

g.p = e
g.o = a
g.u = a
g.x = j
g.t = j
g.s = j
a.p = e
a.v = e
a.y = j
a.q = g
a.u = g
a.z = k
k.z = e
l.p = e
c.r = k
c.v = k
c.s = j
c.y = n
e.p = a
e.s = a
e.o = k
j.p = a
j.r = l
j.v = k
n.r = k
n.v = k
n.s = j
n.y = c
assert n.s.p.y.txt == "j"