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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: H = None
        self.y: E = None
        self.v: G = None
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: G = None
        self.q: H = None
        self.u: J = None
        self.z: J = None
        self.v: E = None
        self.s: B = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: B = None
        self.w: J = None
        self.v: B = None
        self.u: B = None
        self.o: I = None
        self.z: B = None
        self.s: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: H = None
        self.o: C = None
        self.r: H = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: E = None
        self.r: F = None
        self.v: H = None
        self.s: B = None
        self.y: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: H = None
        self.y: E = None
        self.v: G = None
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: G = None
        self.q: H = None
        self.u: J = None
        self.z: J = None
        self.v: E = None
        self.s: B = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: B = None
        self.w: J = None
        self.v: B = None
        self.u: B = None
        self.o: I = None
        self.z: B = None
        self.s: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: H = None
        self.o: C = None
        self.r: H = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: E = None
        self.r: F = None
        self.v: H = None
        self.s: B = None
        self.y: D = None
        self.txt = txt

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

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