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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: B = None
        self.s: B = None
        self.w: D = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: B = None
        self.s: B = None
        self.w: D = None
        self.x: D = None
        self.txt = txt

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

d.r = k
d.t = j
d.o = c
d.u = c
d.q = g
c.z = j
n.q = g
n.o = c
j.v = c
j.y = h
j.t = d
g.o = d
g.r = c
g.s = c
g.w = j
g.x = j
k.r = d
k.t = h
k.o = c
k.u = c
k.q = g
h.v = c
h.y = m
h.t = k
m.v = c
m.y = j
m.t = k
assert g.o.t.y.txt == "h"