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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.q: E = None
        self.t: A = None
        self.s: A = None
        self.txt = txt

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

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

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

g = A("g")
d = B("d")
h = C("h")
c = D("c")
a = E("a")
f = C("f")
m = D("m")
e = C("e")
k = A("k")

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.q: E = None
        self.t: A = None
        self.s: A = None
        self.txt = txt

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

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

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

g = A("g")
d = B("d")
h = C("h")
c = D("c")
a = E("a")
f = C("f")
m = D("m")
e = C("e")
k = A("k")

g.s = e
g.w = a
g.y = k
d.v = k
d.t = k
d.s = k
d.z = g
d.q = a
h.w = f
h.y = d
h.q = d
h.v = c
c.t = g
c.r = a
a.r = h
a.t = h
a.s = c
a.v = f
f.w = e
f.y = d
f.q = d
f.v = c
m.t = k
m.r = a
e.w = f
e.y = d
e.q = d
e.v = m
k.s = h
k.w = a
k.y = g
assert d.q.s.r.s.t.txt == "g"