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

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

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

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

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

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

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

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

e.y = b
e.v = i
i.o = f
i.q = e
i.w = l
i.v = b
b.v = a
b.w = f
g.r = l
g.q = l
g.u = l
g.p = e
g.s = f
g.x = a
a.v = i
a.y = g
a.r = f
l.t = e
f.x = i
f.o = a
assert i.q.y.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

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

e.y = b
e.v = i
i.o = f
i.q = e
i.w = l
i.v = b
b.v = a
b.w = f
g.r = l
g.q = l
g.u = l
g.p = e
g.s = f
g.x = a
a.v = i
a.y = g
a.r = f
l.t = e
f.x = i
f.o = a
assert i.q.y.w.x.txt == "i"