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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: G = None
        self.z: A = None
        self.w: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: E = None
        self.p: I = None
        self.o: D = None
        self.r: A = None
        self.s: I = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: G = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: A = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: G = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: G = None
        self.z: A = None
        self.w: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: E = None
        self.p: I = None
        self.o: D = None
        self.r: A = None
        self.s: I = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: G = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: A = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: G = None
        self.z: C = None
        self.txt = txt

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

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