class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: H = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: A = None
        self.t: F = None
        self.x: D = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: F = None
        self.r: F = None
        self.o: A = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: H = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: A = None
        self.t: F = None
        self.x: D = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: F = None
        self.r: F = None
        self.o: A = None
        self.z: D = None
        self.txt = txt

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

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

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