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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: H = None
        self.p: E = None
        self.o: I = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.y: I = None
        self.s: A = None
        self.v: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: H = None
        self.t: C = None
        self.u: A = None
        self.o: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: I = None
        self.x: B = None
        self.z: C = None
        self.q: E = None
        self.s: H = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: H = None
        self.p: E = None
        self.o: I = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.y: I = None
        self.s: A = None
        self.v: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: H = None
        self.t: C = None
        self.u: A = None
        self.o: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: I = None
        self.x: B = None
        self.z: C = None
        self.q: E = None
        self.s: H = None
        self.w: E = None
        self.txt = txt

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

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