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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: B = None
        self.txt = txt

e = A("e")
j = B("j")
k = C("k")
g = D("g")
l = E("l")
d = E("d")

e.o = k
e.t = k
e.q = d
e.v = g
e.u = g
j.p = g
j.v = g
j.y = e
k.t = e
g.t = k
g.y = j
l.w = e
l.v = j
d.w = e
d.v = j
assert d.v.y.q.v.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: C = None
        self.q: E = None
        self.v: D = None
        self.u: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: B = None
        self.txt = txt

e = A("e")
j = B("j")
k = C("k")
g = D("g")
l = E("l")
d = E("d")

e.o = k
e.t = k
e.q = d
e.v = g
e.u = g
j.p = g
j.v = g
j.y = e
k.t = e
g.t = k
g.y = j
l.w = e
l.v = j
d.w = e
d.v = j
assert d.v.y.q.v.y.q.txt == "d"