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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: F = None
        self.v: E = None
        self.s: C = None
        self.u: F = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: F = None
        self.v: E = None
        self.s: C = None
        self.u: F = None
        self.o: D = None
        self.txt = txt

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

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