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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: E = None
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: G = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: D = None
        self.z: A = None
        self.w: D = None
        self.o: C = None
        self.x: G = None
        self.u: C = None
        self.txt = txt

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

n = A("n")
j = B("j")
c = C("c")
i = D("i")
g = E("g")
f = F("f")
l = G("l")

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: E = None
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: G = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: D = None
        self.z: A = None
        self.w: D = None
        self.o: C = None
        self.x: G = None
        self.u: C = None
        self.txt = txt

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

n = A("n")
j = B("j")
c = C("c")
i = D("i")
g = E("g")
f = F("f")
l = G("l")

n.r = j
n.u = c
n.y = i
n.v = f
j.p = n
c.p = l
c.o = l
c.r = g
i.w = f
i.s = l
i.o = l
i.u = c
i.p = c
i.x = n
g.o = c
g.t = c
g.q = l
f.v = g
f.r = i
f.w = i
f.z = n
f.o = c
f.u = c
f.x = l
l.s = g
l.w = c
assert j.p.r.p.v.o.txt == "c"