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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: D = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: H = None
        self.s: G = None
        self.o: F = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: D = None
        self.t: H = None
        self.x: A = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: D = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: H = None
        self.s: G = None
        self.o: F = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: D = None
        self.t: H = None
        self.x: A = None
        self.r: D = None
        self.txt = txt

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

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

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