class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: E = None
        self.y: A = None
        self.p: D = None
        self.u: F = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: F = None
        self.y: C = None
        self.s: E = None
        self.t: D = None
        self.q: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

d.s = k
d.u = k
d.x = n
d.y = c
d.p = b
d.q = i
m.u = j
m.z = b
l.w = n
l.s = n
l.r = k
l.y = j
l.q = j
l.t = b
b.y = n
n.x = m
n.z = m
k.r = d
j.w = n
j.s = n
j.r = k
j.y = l
j.q = l
j.t = b
i.y = n
c.s = k
c.u = k
c.x = n
c.y = d
c.p = i
c.q = b
assert n.z.z.y.z.z.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: E = None
        self.y: A = None
        self.p: D = None
        self.u: F = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: F = None
        self.y: C = None
        self.s: E = None
        self.t: D = None
        self.q: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

d.s = k
d.u = k
d.x = n
d.y = c
d.p = b
d.q = i
m.u = j
m.z = b
l.w = n
l.s = n
l.r = k
l.y = j
l.q = j
l.t = b
b.y = n
n.x = m
n.z = m
k.r = d
j.w = n
j.s = n
j.r = k
j.y = l
j.q = l
j.t = b
i.y = n
c.s = k
c.u = k
c.x = n
c.y = d
c.p = i
c.q = b
assert n.z.z.y.z.z.y.z.txt == "m"