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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: F = None
        self.t: D = None
        self.u: F = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: F = None
        self.w: F = None
        self.z: J = None
        self.s: F = None
        self.v: J = None
        self.x: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: C = None
        self.t: D = None
        self.x: C = None
        self.o: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: G = None
        self.r: D = None
        self.o: H = None
        self.s: A = None
        self.x: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: F = None
        self.t: D = None
        self.u: F = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: F = None
        self.w: F = None
        self.z: J = None
        self.s: F = None
        self.v: J = None
        self.x: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: C = None
        self.t: D = None
        self.x: C = None
        self.o: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: G = None
        self.r: D = None
        self.o: H = None
        self.s: A = None
        self.x: E = None
        self.txt = txt

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

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