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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: H = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: H = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: H = None
        self.txt = txt

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

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

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