class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: H = None
        self.r: H = None
        self.u: J = None
        self.t: D = None
        self.y: C = None
        self.x: A = None
        self.p: D = None
        self.o: D = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: H = None
        self.q: F = None
        self.s: C = 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.z: H = None
        self.x: I = None
        self.p: C = None
        self.t: E = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: F = None
        self.w: B = None
        self.p: A = None
        self.x: B = None
        self.s: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: H = None
        self.r: H = None
        self.u: J = None
        self.t: D = None
        self.y: C = None
        self.x: A = None
        self.p: D = None
        self.o: D = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: H = None
        self.q: F = None
        self.s: C = 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.z: H = None
        self.x: I = None
        self.p: C = None
        self.t: E = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: F = None
        self.w: B = None
        self.p: A = None
        self.x: B = None
        self.s: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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