class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: E = None
        self.y: C = None
        self.u: C = None
        self.z: D = None
        self.t: B = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: E = None
        self.u: D = None
        self.z: J = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: E = None
        self.z: E = None
        self.y: C = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.q: D = None
        self.p: E = None
        self.y: E = None
        self.z: B = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: A = None
        self.o: E = None
        self.v: A = None
        self.z: D = None
        self.p: C = None
        self.r: E = None
        self.w: F = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: E = None
        self.u: D = None
        self.z: J = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: E = None
        self.z: E = None
        self.y: C = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.q: D = None
        self.p: E = None
        self.y: E = None
        self.z: B = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: A = None
        self.o: E = None
        self.v: A = None
        self.z: D = None
        self.p: C = None
        self.r: E = None
        self.w: F = None
        self.t: D = None
        self.txt = txt

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

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

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

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