class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: E = None
        self.y: J = None
        self.x: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: F = None
        self.u: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: C = None
        self.o: B = None
        self.t: H = None
        self.y: B = None
        self.p: B = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

h = A("h")
m = B("m")
d = C("d")
b = D("b")
e = E("e")
i = F("i")
c = G("c")
j = H("j")
n = I("n")
g = J("g")

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: F = None
        self.u: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: C = None
        self.o: B = None
        self.t: H = None
        self.y: B = None
        self.p: B = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

h = A("h")
m = B("m")
d = C("d")
b = D("b")
e = E("e")
i = F("i")
c = G("c")
j = H("j")
n = I("n")
g = J("g")

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