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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.w: F = None
        self.p: C = None
        self.u: C = None
        self.t: F = None
        self.txt = txt

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

g.u = e
g.x = b
b.o = f
b.z = f
b.x = g
i.p = c
i.u = c
i.v = f
i.z = f
i.t = e
i.o = g
e.u = f
e.q = b
f.w = g
f.v = g
f.s = b
n.z = e
n.v = b
n.s = f
c.s = i
c.p = i
c.u = i
c.q = g
c.w = n
c.t = n
assert g.u.q.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.w: F = None
        self.p: C = None
        self.u: C = None
        self.t: F = None
        self.txt = txt

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

g.u = e
g.x = b
b.o = f
b.z = f
b.x = g
i.p = c
i.u = c
i.v = f
i.z = f
i.t = e
i.o = g
e.u = f
e.q = b
f.w = g
f.v = g
f.s = b
n.z = e
n.v = b
n.s = f
c.s = i
c.p = i
c.u = i
c.q = g
c.w = n
c.t = n
assert g.u.q.x.x.txt == "b"