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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: F = None
        self.w: H = None
        self.o: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: E = None
        self.o: E = None
        self.u: B = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: E = None
        self.r: E = None
        self.q: G = None
        self.t: B = None
        self.u: G = None
        self.o: G = None
        self.txt = txt

n = A("n")
i = B("i")
h = C("h")
l = D("l")
g = E("g")
f = F("f")
j = G("j")
k = H("k")

n.w = j
n.u = g
i.q = f
i.r = f
i.w = k
i.o = n
h.q = g
h.u = g
h.r = k
h.o = f
h.x = i
l.r = j
l.x = n
g.w = h
f.w = j
f.t = k
f.v = l
j.r = n
j.q = n
j.z = g
j.o = g
j.u = i
k.v = h
k.w = g
k.r = g
k.q = j
k.u = j
k.o = j
k.t = i
assert f.w.u.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: F = None
        self.w: H = None
        self.o: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: E = None
        self.o: E = None
        self.u: B = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: E = None
        self.r: E = None
        self.q: G = None
        self.t: B = None
        self.u: G = None
        self.o: G = None
        self.txt = txt

n = A("n")
i = B("i")
h = C("h")
l = D("l")
g = E("g")
f = F("f")
j = G("j")
k = H("k")

n.w = j
n.u = g
i.q = f
i.r = f
i.w = k
i.o = n
h.q = g
h.u = g
h.r = k
h.o = f
h.x = i
l.r = j
l.x = n
g.w = h
f.w = j
f.t = k
f.v = l
j.r = n
j.q = n
j.z = g
j.o = g
j.u = i
k.v = h
k.w = g
k.r = g
k.q = j
k.u = j
k.o = j
k.t = i
assert f.w.u.w.r.txt == "g"