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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: E = None
        self.t: G = None
        self.y: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: G = None
        self.z: F = None
        self.p: F = None
        self.q: F = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: A = None
        self.p: E = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

f = A("f")
a = B("a")
j = C("j")
n = D("n")
d = E("d")
c = F("c")
i = G("i")
e = G("e")
l = F("l")
b = A("b")

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: E = None
        self.t: G = None
        self.y: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: G = None
        self.z: F = None
        self.p: F = None
        self.q: F = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: A = None
        self.p: E = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

f = A("f")
a = B("a")
j = C("j")
n = D("n")
d = E("d")
c = F("c")
i = G("i")
e = G("e")
l = F("l")
b = A("b")

f.p = a
f.s = n
f.q = e
f.o = j
f.v = c
a.q = n
a.y = n
a.x = d
a.t = e
j.o = f
n.y = f
n.u = j
d.u = l
d.z = l
d.q = l
d.t = e
d.p = c
d.o = a
c.r = l
c.s = f
c.p = d
c.x = a
i.q = a
e.q = a
l.r = c
l.s = b
l.p = d
l.x = a
b.p = a
b.s = n
b.q = i
b.o = j
b.v = c
assert c.r.r.x.t.q.q.txt == "n"