class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: F = None
        self.z: D = None
        self.y: C = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: A = None
        self.txt = txt

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

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

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