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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: G = None
        self.x: E = None
        self.p: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: E = None
        self.s: C = None
        self.z: B = None
        self.txt = txt

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

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

g.w = j
g.x = j
g.z = c
g.o = c
d.q = n
d.w = c
d.x = j
d.p = g
n.t = j
n.v = j
e.x = i
e.u = c
e.v = d
j.q = e
j.o = g
i.q = n
i.s = n
i.w = j
i.z = d
c.x = i
c.s = n
assert i.z.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: G = None
        self.x: E = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: G = None
        self.x: E = None
        self.p: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: E = None
        self.s: C = None
        self.z: B = None
        self.txt = txt

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

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

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