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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: E = None
        self.w: C = None
        self.s: A = None
        self.r: D = None
        self.z: A = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: E = None
        self.w: C = None
        self.s: A = None
        self.r: D = None
        self.z: A = None
        self.x: D = None
        self.txt = txt

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

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

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