class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

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

j = A("j")
c = B("c")
i = C("i")
d = D("d")
m = E("m")
b = E("b")
f = D("f")
h = A("h")
g = D("g")
a = D("a")

j.r = b
c.q = f
c.y = f
c.z = h
c.o = i
c.t = b
i.w = d
i.q = c
i.v = h
d.o = i
d.r = c
m.x = g
m.s = a
m.r = c
m.t = i
b.x = a
b.s = a
b.r = c
b.t = i
f.o = i
f.r = c
h.r = b
g.o = i
g.r = c
a.o = i
a.r = c
assert g.o.q.z.r.t.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

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

j = A("j")
c = B("c")
i = C("i")
d = D("d")
m = E("m")
b = E("b")
f = D("f")
h = A("h")
g = D("g")
a = D("a")

j.r = b
c.q = f
c.y = f
c.z = h
c.o = i
c.t = b
i.w = d
i.q = c
i.v = h
d.o = i
d.r = c
m.x = g
m.s = a
m.r = c
m.t = i
b.x = a
b.s = a
b.r = c
b.t = i
f.o = i
f.r = c
h.r = b
g.o = i
g.r = c
a.o = i
a.r = c
assert g.o.q.z.r.t.q.o.txt == "i"