class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: I = None
        self.q: E = None
        self.o: G = None
        self.u: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: F = None
        self.z: F = None
        self.t: I = None
        self.q: B = None
        self.r: A = None
        self.y: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: H = None
        self.q: H = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: J = None
        self.s: B = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: J = None
        self.w: A = None
        self.o: A = None
        self.x: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: F = None
        self.z: F = None
        self.t: I = None
        self.q: B = None
        self.r: A = None
        self.y: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: H = None
        self.q: H = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: J = None
        self.s: B = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: J = None
        self.w: A = None
        self.o: A = None
        self.x: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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