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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.x: D = None
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: F = None
        self.q: H = None
        self.o: H = None
        self.z: E = None
        self.p: B = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.x: D = None
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: F = None
        self.q: H = None
        self.o: H = None
        self.z: E = None
        self.p: B = None
        self.r: G = None
        self.txt = txt

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

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

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

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