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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: H = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: F = None
        self.s: D = None
        self.w: D = None
        self.z: D = None
        self.v: C = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: B = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
g = C("g")
h = D("h")
d = E("d")
i = F("i")
l = G("l")
k = H("k")

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: H = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: F = None
        self.s: D = None
        self.w: D = None
        self.z: D = None
        self.v: C = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: B = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
g = C("g")
h = D("h")
d = E("d")
i = F("i")
l = G("l")
k = H("k")

m.x = g
m.q = h
a.v = d
g.p = a
g.u = i
g.x = h
h.z = m
h.p = k
h.t = g
d.t = m
d.y = i
d.s = h
d.w = h
d.z = h
d.v = g
d.r = a
i.u = g
i.v = a
l.z = d
l.t = d
k.u = d
k.y = l
k.q = l
assert m.q.p.q.txt == "l"