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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: G = None
        self.p: A = None
        self.x: C = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: B = None
        self.v: E = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.z: B = None
        self.u: B = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

h = A("h")
c = B("c")
g = C("g")
l = D("l")
n = E("n")
a = F("a")
b = G("b")
k = H("k")
f = B("f")
d = F("d")

h.r = n
h.x = b
h.o = d
h.u = k
h.p = k
h.s = k
h.z = l
h.q = l
c.q = f
c.w = b
c.p = h
c.v = h
c.x = g
g.z = n
g.v = n
g.w = c
g.s = l
l.x = h
n.u = g
n.o = l
n.z = c
n.r = d
a.o = h
a.x = h
a.w = n
a.z = f
a.u = f
b.s = f
k.z = l
f.q = c
f.w = b
f.p = h
f.v = h
f.x = g
d.o = h
d.x = h
d.w = n
d.z = c
d.u = f
assert f.w.s.w.s.v.x.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: G = None
        self.o: F = None
        self.u: H = None
        self.z: D = None
        self.p: H = None
        self.q: D = None
        self.s: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: G = None
        self.p: A = None
        self.x: C = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: B = None
        self.v: E = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.z: B = None
        self.u: B = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

h = A("h")
c = B("c")
g = C("g")
l = D("l")
n = E("n")
a = F("a")
b = G("b")
k = H("k")
f = B("f")
d = F("d")

h.r = n
h.x = b
h.o = d
h.u = k
h.p = k
h.s = k
h.z = l
h.q = l
c.q = f
c.w = b
c.p = h
c.v = h
c.x = g
g.z = n
g.v = n
g.w = c
g.s = l
l.x = h
n.u = g
n.o = l
n.z = c
n.r = d
a.o = h
a.x = h
a.w = n
a.z = f
a.u = f
b.s = f
k.z = l
f.q = c
f.w = b
f.p = h
f.v = h
f.x = g
d.o = h
d.x = h
d.w = n
d.z = c
d.u = f
assert f.w.s.w.s.v.x.s.x.txt == "g"