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

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

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: D = None
        self.o: B = None
        self.s: G = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: A = None
        self.p: D = None
        self.r: B = None
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: F = None
        self.txt = txt

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

k = A("k")
j = B("j")
g = C("g")
a = D("a")
c = E("c")
l = F("l")
h = G("h")
b = H("b")
i = I("i")
n = J("n")

k.y = b
k.o = a
k.v = g
j.r = k
j.t = k
j.y = l
g.o = n
g.r = a
a.t = h
a.x = l
c.w = k
c.p = k
c.t = k
c.o = g
l.p = b
l.y = a
l.o = j
l.w = j
l.s = h
h.r = c
b.z = c
b.v = k
b.p = a
b.r = j
b.o = g
i.w = g
i.y = l
n.r = g
n.t = j
n.s = c
n.w = l
n.v = l
n.x = b
n.p = a
n.y = k
n.q = i
assert h.r.o.r.t.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: D = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: D = None
        self.o: B = None
        self.s: G = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: A = None
        self.p: D = None
        self.r: B = None
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: F = None
        self.txt = txt

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

k = A("k")
j = B("j")
g = C("g")
a = D("a")
c = E("c")
l = F("l")
h = G("h")
b = H("b")
i = I("i")
n = J("n")

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