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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: D = None
        self.s: G = None
        self.w: G = None
        self.p: F = None
        self.z: A = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: F = None
        self.s: F = None
        self.r: D = None
        self.y: D = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: A = None
        self.o: A = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: C = None
        self.p: F = None
        self.x: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: D = None
        self.s: G = None
        self.w: G = None
        self.p: F = None
        self.z: A = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: F = None
        self.s: F = None
        self.r: D = None
        self.y: D = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: A = None
        self.o: A = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: C = None
        self.p: F = None
        self.x: B = None
        self.txt = txt

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

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