class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: H = None
        self.x: H = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: F = None
        self.x: H = None
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: H = None
        self.s: A = None
        self.q: F = None
        self.p: F = None
        self.txt = txt

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

m = A("m")
n = B("n")
l = C("l")
f = D("f")
c = E("c")
h = F("h")
j = G("j")
k = H("k")

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: F = None
        self.x: H = None
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: H = None
        self.s: A = None
        self.q: F = None
        self.p: F = None
        self.txt = txt

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

m = A("m")
n = B("n")
l = C("l")
f = D("f")
c = E("c")
h = F("h")
j = G("j")
k = H("k")

m.p = j
m.w = k
m.x = k
m.y = h
n.s = l
n.q = h
n.z = h
n.x = k
l.w = h
l.o = m
l.s = m
l.y = k
l.u = c
l.t = j
l.r = j
f.w = l
f.x = l
f.s = n
f.y = c
c.s = k
c.z = m
c.v = h
h.s = f
h.u = f
h.w = n
h.o = c
h.q = c
h.y = m
j.t = c
j.y = k
j.s = m
j.q = h
j.p = h
k.r = h
k.z = h
k.v = h
k.s = n
k.x = m
k.t = j
assert m.y.y.x.x.y.txt == "h"