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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: F = None
        self.p: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: D = None
        self.z: F = None
        self.o: B = None
        self.r: B = None
        self.txt = txt

g = A("g")
n = B("n")
f = C("f")
h = D("h")
i = E("i")
l = F("l")
a = G("a")
b = H("b")

g.x = a
g.p = h
n.y = i
n.v = i
n.r = i
n.q = a
n.u = a
n.p = a
n.t = f
n.w = h
f.r = n
f.w = l
f.q = l
f.v = l
f.u = b
f.s = i
f.o = h
f.t = g
h.s = f
h.q = l
h.p = l
i.u = g
l.t = h
a.p = i
a.t = i
a.r = i
a.z = i
a.x = g
a.o = h
a.u = f
b.s = f
b.p = h
b.z = l
b.o = n
b.r = n
assert b.r.t.s.u.p.s.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: F = None
        self.p: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: D = None
        self.z: F = None
        self.o: B = None
        self.r: B = None
        self.txt = txt

g = A("g")
n = B("n")
f = C("f")
h = D("h")
i = E("i")
l = F("l")
a = G("a")
b = H("b")

g.x = a
g.p = h
n.y = i
n.v = i
n.r = i
n.q = a
n.u = a
n.p = a
n.t = f
n.w = h
f.r = n
f.w = l
f.q = l
f.v = l
f.u = b
f.s = i
f.o = h
f.t = g
h.s = f
h.q = l
h.p = l
i.u = g
l.t = h
a.p = i
a.t = i
a.r = i
a.z = i
a.x = g
a.o = h
a.u = f
b.s = f
b.p = h
b.z = l
b.o = n
b.r = n
assert b.r.t.s.u.p.s.o.p.txt == "l"