class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: C = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.v: E = None
        self.w: D = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: I = 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.p: B = None
        self.v: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: E = None
        self.x: I = None
        self.z: G = None
        self.p: D = None
        self.v: C = None
        self.s: A = None
        self.o: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.v: E = None
        self.w: D = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: I = 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.p: B = None
        self.v: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: E = None
        self.x: I = None
        self.z: G = None
        self.p: D = None
        self.v: C = None
        self.s: A = None
        self.o: I = None
        self.txt = txt

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

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