class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: A = None
        self.t: E = None
        self.u: B = None
        self.q: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

c.y = j
c.o = j
c.t = n
c.q = n
c.u = k
k.y = g
k.p = d
k.x = c
e.r = j
e.q = k
d.o = e
d.y = n
n.v = e
j.y = c
j.o = c
j.t = n
j.q = n
j.u = k
g.o = e
g.y = n
assert j.o.y.u.x.u.txt == "k"