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

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

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

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

g = A("g")
i = B("i")
b = C("b")
d = D("d")
a = A("a")
k = B("k")
e = C("e")
c = B("c")

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

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

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

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

g = A("g")
i = B("i")
b = C("b")
d = D("d")
a = A("a")
k = B("k")
e = C("e")
c = B("c")

g.r = a
g.w = a
g.z = i
g.y = b
i.t = c
i.p = e
i.s = g
b.r = c
b.p = i
b.o = i
b.u = k
d.z = b
d.y = b
d.r = k
a.r = g
a.w = g
a.z = i
a.y = b
k.t = i
k.p = e
k.s = a
e.r = i
e.u = i
e.o = i
e.p = c
c.t = k
c.p = b
c.s = a
assert i.s.y.u.t.s.r.txt == "a"