class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: E = None
        self.q: F = None
        self.v: E = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: F = None
        self.r: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

e = A("e")
b = B("b")
k = C("k")
h = D("h")
a = E("a")
g = F("g")
i = G("i")

e.w = k
e.u = a
e.v = a
e.q = g
e.o = h
b.u = g
b.v = g
b.r = g
k.v = g
k.o = e
k.x = h
h.o = e
h.w = b
a.o = k
a.y = b
a.z = i
a.r = h
g.o = e
i.r = a
assert g.o.o.o.w.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: E = None
        self.q: F = None
        self.v: E = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: F = None
        self.r: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

e = A("e")
b = B("b")
k = C("k")
h = D("h")
a = E("a")
g = F("g")
i = G("i")

e.w = k
e.u = a
e.v = a
e.q = g
e.o = h
b.u = g
b.v = g
b.r = g
k.v = g
k.o = e
k.x = h
h.o = e
h.w = b
a.o = k
a.y = b
a.z = i
a.r = h
g.o = e
i.r = a
assert g.o.o.o.w.v.o.txt == "e"