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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: H = None
        self.w: E = None
        self.t: A = None
        self.o: B = None
        self.y: H = None
        self.r: H = None
        self.x: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: G = None
        self.x: C = None
        self.v: A = None
        self.q: B = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: H = None
        self.r: C = None
        self.x: E = None
        self.u: A = None
        self.y: F = None
        self.v: C = None
        self.t: F = None
        self.txt = txt

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

d = A("d")
h = B("h")
e = C("e")
f = D("f")
i = E("i")
m = F("m")
c = G("c")
n = H("n")

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: H = None
        self.w: E = None
        self.t: A = None
        self.o: B = None
        self.y: H = None
        self.r: H = None
        self.x: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: G = None
        self.x: C = None
        self.v: A = None
        self.q: B = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: H = None
        self.r: C = None
        self.x: E = None
        self.u: A = None
        self.y: F = None
        self.v: C = None
        self.t: F = None
        self.txt = txt

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

d = A("d")
h = B("h")
e = C("e")
f = D("f")
i = E("i")
m = F("m")
c = G("c")
n = H("n")

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