class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: D = None
        self.z: E = None
        self.x: C = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: H = None
        self.v: H = None
        self.q: E = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: C = None
        self.r: A = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: D = None
        self.z: E = None
        self.x: C = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: H = None
        self.v: H = None
        self.q: E = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: C = None
        self.r: A = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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