class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: B = None
        self.v: E = None
        self.q: E = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: D = None
        self.z: C = None
        self.o: A = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.x: C = None
        self.z: C = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: E = None
        self.r: C = None
        self.txt = txt

e = A("e")
g = B("g")
b = C("b")
d = D("d")
c = E("c")
j = E("j")

e.s = b
e.r = g
e.x = g
e.v = c
e.q = j
g.v = e
g.o = e
g.q = d
g.t = d
g.z = b
b.o = d
d.p = e
d.s = g
d.r = g
d.x = b
d.z = b
c.y = g
c.x = j
c.r = b
j.y = g
j.x = c
j.r = b
assert c.y.v.v.y.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: B = None
        self.v: E = None
        self.q: E = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: D = None
        self.z: C = None
        self.o: A = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.x: C = None
        self.z: C = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: E = None
        self.r: C = None
        self.txt = txt

e = A("e")
g = B("g")
b = C("b")
d = D("d")
c = E("c")
j = E("j")

e.s = b
e.r = g
e.x = g
e.v = c
e.q = j
g.v = e
g.o = e
g.q = d
g.t = d
g.z = b
b.o = d
d.p = e
d.s = g
d.r = g
d.x = b
d.z = b
c.y = g
c.x = j
c.r = b
j.y = g
j.x = c
j.r = b
assert c.y.v.v.y.t.p.txt == "e"