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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: B = None
        self.z: B = None
        self.w: C = None
        self.q: B = None
        self.o: B = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: G = None
        self.v: A = None
        self.q: B = None
        self.u: B = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: G = None
        self.w: C = None
        self.q: A = None
        self.y: E = None
        self.u: A = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: B = None
        self.y: C = None
        self.z: E = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: C = None
        self.y: H = None
        self.z: D = None
        self.p: B = None
        self.r: C = None
        self.s: A = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

m = A("m")
f = B("f")
g = C("g")
n = D("n")
k = E("k")
c = F("c")
d = G("d")
h = H("h")
j = B("j")
l = A("l")

m.p = d
m.u = k
m.z = j
f.r = m
f.v = j
f.z = j
f.q = j
f.o = j
f.w = g
f.u = k
g.y = c
g.s = d
g.v = m
g.q = j
g.u = f
g.t = h
n.p = k
n.y = k
n.z = d
n.w = g
n.s = g
n.q = m
n.u = l
k.p = j
k.t = j
k.q = h
k.o = m
c.p = f
c.t = j
c.q = j
c.y = g
c.z = k
d.q = j
d.p = j
d.v = g
d.r = g
d.y = h
d.w = h
d.z = n
d.s = m
h.y = c
j.r = m
j.v = f
j.z = f
j.q = f
j.o = f
j.w = g
j.u = k
l.p = d
l.u = k
l.z = f
assert c.q.r.p.s.p.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: E = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: B = None
        self.z: B = None
        self.w: C = None
        self.q: B = None
        self.o: B = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: G = None
        self.v: A = None
        self.q: B = None
        self.u: B = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: G = None
        self.w: C = None
        self.q: A = None
        self.y: E = None
        self.u: A = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: B = None
        self.y: C = None
        self.z: E = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: C = None
        self.y: H = None
        self.z: D = None
        self.p: B = None
        self.r: C = None
        self.s: A = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

m = A("m")
f = B("f")
g = C("g")
n = D("n")
k = E("k")
c = F("c")
d = G("d")
h = H("h")
j = B("j")
l = A("l")

m.p = d
m.u = k
m.z = j
f.r = m
f.v = j
f.z = j
f.q = j
f.o = j
f.w = g
f.u = k
g.y = c
g.s = d
g.v = m
g.q = j
g.u = f
g.t = h
n.p = k
n.y = k
n.z = d
n.w = g
n.s = g
n.q = m
n.u = l
k.p = j
k.t = j
k.q = h
k.o = m
c.p = f
c.t = j
c.q = j
c.y = g
c.z = k
d.q = j
d.p = j
d.v = g
d.r = g
d.y = h
d.w = h
d.z = n
d.s = m
h.y = c
j.r = m
j.v = f
j.z = f
j.q = f
j.o = f
j.w = g
j.u = k
l.p = d
l.u = k
l.z = f
assert c.q.r.p.s.p.s.p.txt == "d"