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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: D = None
        self.t: J = None
        self.x: J = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.z: G = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: J = None
        self.p: G = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: A = None
        self.q: H = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: C = None
        self.x: A = None
        self.r: G = None
        self.o: I = None
        self.w: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: J = None
        self.v: C = None
        self.txt = txt

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

k = A("k")
j = B("j")
c = C("c")
e = D("e")
g = E("g")
d = F("d")
f = G("f")
h = H("h")
b = I("b")
a = J("a")

k.u = f
j.p = e
j.o = e
j.t = a
j.x = a
j.q = c
c.w = a
c.z = f
c.p = e
e.r = g
e.v = a
e.p = f
e.q = c
g.x = h
g.q = h
g.w = k
g.r = b
d.v = c
d.q = c
d.x = k
d.r = f
d.o = b
d.w = h
f.y = g
f.w = a
f.s = k
h.s = k
b.t = h
b.u = a
b.v = c
a.t = e
a.q = h
a.z = j
assert g.r.u.t.r.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: D = None
        self.t: J = None
        self.x: J = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.z: G = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: J = None
        self.p: G = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: A = None
        self.q: H = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: C = None
        self.x: A = None
        self.r: G = None
        self.o: I = None
        self.w: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: J = None
        self.v: C = None
        self.txt = txt

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

k = A("k")
j = B("j")
c = C("c")
e = D("e")
g = E("g")
d = F("d")
f = G("f")
h = H("h")
b = I("b")
a = J("a")

k.u = f
j.p = e
j.o = e
j.t = a
j.x = a
j.q = c
c.w = a
c.z = f
c.p = e
e.r = g
e.v = a
e.p = f
e.q = c
g.x = h
g.q = h
g.w = k
g.r = b
d.v = c
d.q = c
d.x = k
d.r = f
d.o = b
d.w = h
f.y = g
f.w = a
f.s = k
h.s = k
b.t = h
b.u = a
b.v = c
a.t = e
a.q = h
a.z = j
assert g.r.u.t.r.r.t.txt == "h"