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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.z: A = None
        self.txt = txt

g = A("g")
b = B("b")
e = C("e")
h = D("h")
k = C("k")
c = C("c")
f = B("f")
a = D("a")

g.s = e
g.z = f
b.t = f
e.v = g
e.y = g
e.q = c
e.s = h
h.s = g
h.z = g
h.p = a
k.v = g
k.y = g
k.q = c
k.s = h
c.v = g
c.y = g
c.q = e
c.s = h
f.t = b
a.s = g
a.z = g
a.p = h
assert c.y.z.t.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.z: A = None
        self.txt = txt

g = A("g")
b = B("b")
e = C("e")
h = D("h")
k = C("k")
c = C("c")
f = B("f")
a = D("a")

g.s = e
g.z = f
b.t = f
e.v = g
e.y = g
e.q = c
e.s = h
h.s = g
h.z = g
h.p = a
k.v = g
k.y = g
k.q = c
k.s = h
c.v = g
c.y = g
c.q = e
c.s = h
f.t = b
a.s = g
a.z = g
a.p = h
assert c.y.z.t.t.t.t.t.txt == "b"