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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.p: B = None
        self.w: H = None
        self.o: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: E = None
        self.txt = txt

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

g.p = c
g.x = a
g.u = m
a.s = g
a.p = b
l.r = c
b.u = a
b.r = a
b.v = h
j.x = c
j.r = m
j.o = e
m.v = e
m.w = e
m.o = f
h.q = c
h.p = a
h.w = f
h.o = e
f.t = b
f.q = b
f.p = c
f.v = c
f.x = l
f.w = h
f.s = a
f.y = e
e.w = b
e.s = h
c.y = l
c.v = j
assert g.p.v.r.o.y.w.u.p.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: J = None
        self.x: B = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.p: B = None
        self.w: H = None
        self.o: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: E = None
        self.txt = txt

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

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