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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: C = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: C = None
        self.w: C = None
        self.x: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: A = None
        self.t: E = None
        self.u: F = None
        self.z: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: C = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: C = None
        self.w: C = None
        self.x: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: A = None
        self.t: E = None
        self.u: F = None
        self.z: A = None
        self.txt = txt

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

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