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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: F = None
        self.v: A = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: E = None
        self.t: A = None
        self.y: A = None
        self.w: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: F = None
        self.v: A = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: E = None
        self.t: A = None
        self.y: A = None
        self.w: A = None
        self.txt = txt

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

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

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