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

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

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

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

c = A("c")
k = B("k")
i = C("i")
b = D("b")
m = B("m")
e = C("e")
j = C("j")
n = A("n")
l = B("l")

c.u = n
c.s = n
c.z = n
k.t = n
k.p = l
i.q = e
b.v = m
b.z = n
b.r = c
b.q = c
m.t = n
m.p = l
e.q = i
j.q = e
n.u = c
n.s = c
n.z = c
l.t = n
l.p = k
assert e.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: A = None
        self.z: A = None
        self.txt = txt

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

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

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

c = A("c")
k = B("k")
i = C("i")
b = D("b")
m = B("m")
e = C("e")
j = C("j")
n = A("n")
l = B("l")

c.u = n
c.s = n
c.z = n
k.t = n
k.p = l
i.q = e
b.v = m
b.z = n
b.r = c
b.q = c
m.t = n
m.p = l
e.q = i
j.q = e
n.u = c
n.s = c
n.z = c
l.t = n
l.p = k
assert e.q.q.q.txt == "i"