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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: F = None
        self.u: B = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: G = None
        self.y: D = None
        self.v: F = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: C = None
        self.u: G = None
        self.r: B = None
        self.v: D = None
        self.q: I = None
        self.x: D = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: F = None
        self.p: B = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: C = None
        self.t: D = None
        self.v: I = None
        self.s: A = None
        self.y: G = None
        self.z: A = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: G = None
        self.t: G = None
        self.o: A = None
        self.s: F = None
        self.q: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: F = None
        self.u: B = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: G = None
        self.y: D = None
        self.v: F = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: C = None
        self.u: G = None
        self.r: B = None
        self.v: D = None
        self.q: I = None
        self.x: D = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: F = None
        self.p: B = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: C = None
        self.t: D = None
        self.v: I = None
        self.s: A = None
        self.y: G = None
        self.z: A = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: G = None
        self.t: G = None
        self.o: A = None
        self.s: F = None
        self.q: C = None
        self.txt = txt

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

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