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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: C = None
        self.s: E = None
        self.x: B = None
        self.v: G = None
        self.p: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.p: J = None
        self.w: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: C = None
        self.s: E = None
        self.x: B = None
        self.v: G = None
        self.p: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.p: J = None
        self.w: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: H = None
        self.txt = txt

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

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