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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.r: C = None
        self.x: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.o: C = None
        self.u: B = None
        self.s: D = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.r: C = None
        self.x: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.o: C = None
        self.u: B = None
        self.s: D = None
        self.w: B = None
        self.txt = txt

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

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