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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: E = None
        self.y: C = None
        self.x: B = None
        self.o: A = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: E = None
        self.w: F = None
        self.txt = txt

l = A("l")
g = B("g")
j = C("j")
c = D("c")
n = E("n")
d = F("d")
i = G("i")
h = H("h")

l.u = d
l.w = c
l.x = n
g.p = c
g.x = i
g.u = j
j.x = h
j.z = h
j.w = l
j.r = g
j.p = c
j.v = i
j.t = d
c.r = g
c.z = g
n.y = j
n.s = i
n.z = i
n.r = d
n.u = c
n.q = c
d.p = n
i.w = l
i.o = l
i.q = n
i.y = j
i.x = g
i.t = d
h.q = i
h.o = n
h.w = d
assert n.y.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: D = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: E = None
        self.y: C = None
        self.x: B = None
        self.o: A = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: E = None
        self.w: F = None
        self.txt = txt

l = A("l")
g = B("g")
j = C("j")
c = D("c")
n = E("n")
d = F("d")
i = G("i")
h = H("h")

l.u = d
l.w = c
l.x = n
g.p = c
g.x = i
g.u = j
j.x = h
j.z = h
j.w = l
j.r = g
j.p = c
j.v = i
j.t = d
c.r = g
c.z = g
n.y = j
n.s = i
n.z = i
n.r = d
n.u = c
n.q = c
d.p = n
i.w = l
i.o = l
i.q = n
i.y = j
i.x = g
i.t = d
h.q = i
h.o = n
h.w = d
assert n.y.w.x.txt == "n"