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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: A = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: D = None
        self.p: C = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: B = None
        self.txt = txt

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

m = A("m")
e = B("e")
k = C("k")
h = D("h")
l = E("l")
a = F("a")
f = G("f")
n = H("n")

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: A = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: D = None
        self.p: C = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: B = None
        self.txt = txt

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

m = A("m")
e = B("e")
k = C("k")
h = D("h")
l = E("l")
a = F("a")
f = G("f")
n = H("n")

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