class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: C = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: D = None
        self.s: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: D = None
        self.s: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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