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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: D = None
        self.v: G = None
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.o: A = None
        self.u: D = None
        self.p: H = None
        self.q: D = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: H = None
        self.z: D = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: D = None
        self.v: G = None
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.o: A = None
        self.u: D = None
        self.p: H = None
        self.q: D = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: H = None
        self.z: D = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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