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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.txt = txt

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

n = A("n")
e = B("e")
d = C("d")
a = D("a")
c = E("c")
b = F("b")
i = G("i")

n.w = b
n.y = d
e.s = i
e.x = i
d.o = c
d.s = n
a.u = n
a.y = b
a.t = e
c.v = e
b.u = d
b.t = c
i.w = e
i.y = e
i.r = c
i.o = c
assert a.t.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.txt = txt

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

n = A("n")
e = B("e")
d = C("d")
a = D("a")
c = E("c")
b = F("b")
i = G("i")

n.w = b
n.y = d
e.s = i
e.x = i
d.o = c
d.s = n
a.u = n
a.y = b
a.t = e
c.v = e
b.u = d
b.t = c
i.w = e
i.y = e
i.r = c
i.o = c
assert a.t.x.y.txt == "e"