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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: G = None
        self.r: I = None
        self.y: I = None
        self.z: F = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: E = None
        self.u: I = None
        self.r: B = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: B = None
        self.u: D = None
        self.s: I = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: G = None
        self.o: H = None
        self.r: D = None
        self.q: F = None
        self.w: E = None
        self.s: F = None
        self.v: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: G = None
        self.r: I = None
        self.y: I = None
        self.z: F = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: E = None
        self.u: I = None
        self.r: B = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: B = None
        self.u: D = None
        self.s: I = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: G = None
        self.o: H = None
        self.r: D = None
        self.q: F = None
        self.w: E = None
        self.s: F = None
        self.v: A = None
        self.txt = txt

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

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