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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: E = None
        self.t: A = None
        self.r: A = None
        self.q: A = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: E = None
        self.v: E = None
        self.txt = txt

f = A("f")
b = B("b")
i = C("i")
l = D("l")
g = E("g")
c = F("c")
d = A("d")
h = E("h")
n = C("n")
k = F("k")

f.p = l
f.r = l
b.r = n
b.q = n
i.y = l
i.t = c
i.p = g
i.r = k
i.w = k
l.x = b
l.v = g
l.t = d
l.q = d
l.r = f
l.y = c
g.z = f
g.u = b
g.y = b
g.r = b
g.s = d
g.o = n
c.z = k
c.s = g
c.v = h
d.p = l
d.r = l
h.z = f
h.s = f
h.u = b
h.y = b
h.r = b
h.o = i
n.y = l
n.t = c
n.r = c
n.p = h
n.w = k
k.z = c
k.s = g
k.v = g
assert n.r.s.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: E = None
        self.t: A = None
        self.r: A = None
        self.q: A = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: E = None
        self.v: E = None
        self.txt = txt

f = A("f")
b = B("b")
i = C("i")
l = D("l")
g = E("g")
c = F("c")
d = A("d")
h = E("h")
n = C("n")
k = F("k")

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