class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: E = None
        self.o: J = None
        self.r: H = None
        self.w: C = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: F = None
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: F = None
        self.q: I = None
        self.t: F = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: F = None
        self.o: J = None
        self.w: B = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: B = None
        self.x: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: I = None
        self.y: C = None
        self.x: A = None
        self.o: B = None
        self.v: E = None
        self.u: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: F = None
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: F = None
        self.q: I = None
        self.t: F = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: F = None
        self.o: J = None
        self.w: B = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: B = None
        self.x: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: I = None
        self.y: C = None
        self.x: A = None
        self.o: B = None
        self.v: E = None
        self.u: E = None
        self.txt = txt

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

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