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

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

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

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

h = A("h")
c = B("c")
k = C("k")
i = D("i")
g = A("g")
d = A("d")
e = D("e")
l = A("l")

h.z = k
h.s = k
h.v = i
c.y = k
k.q = c
k.s = c
k.x = c
k.y = c
i.p = g
i.z = c
g.z = k
g.s = k
g.v = e
d.z = k
d.s = k
d.v = e
e.p = h
e.z = c
l.z = k
l.s = k
l.v = e
assert e.z.y.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: C = None
        self.v: D = None
        self.txt = txt

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

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

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

h = A("h")
c = B("c")
k = C("k")
i = D("i")
g = A("g")
d = A("d")
e = D("e")
l = A("l")

h.z = k
h.s = k
h.v = i
c.y = k
k.q = c
k.s = c
k.x = c
k.y = c
i.p = g
i.z = c
g.z = k
g.s = k
g.v = e
d.z = k
d.s = k
d.v = e
e.p = h
e.z = c
l.z = k
l.s = k
l.v = e
assert e.z.y.s.y.txt == "k"