class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: I = None
        self.x: F = None
        self.v: G = None
        self.y: G = None
        self.p: I = None
        self.t: B = None
        self.w: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: D = None
        self.w: I = None
        self.u: D = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.z: F = None
        self.o: F = None
        self.v: I = None
        self.y: I = None
        self.t: I = None
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: J = None
        self.x: C = None
        self.q: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.w: G = None
        self.u: H = None
        self.s: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: D = None
        self.w: I = None
        self.u: D = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.z: F = None
        self.o: F = None
        self.v: I = None
        self.y: I = None
        self.t: I = None
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: J = None
        self.x: C = None
        self.q: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.w: G = None
        self.u: H = None
        self.s: I = None
        self.txt = txt

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

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