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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: G = None
        self.p: D = None
        self.txt = txt

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

a = A("a")
e = B("e")
i = C("i")
f = D("f")
k = E("k")
c = F("c")
g = G("g")
j = C("j")
l = F("l")
b = G("b")

a.w = l
a.y = c
a.x = e
a.r = f
a.v = k
e.y = f
i.w = c
i.v = f
f.x = a
f.q = b
f.p = i
k.z = e
c.q = b
c.z = g
c.p = f
g.p = e
g.s = c
j.w = c
j.v = f
l.q = g
l.z = b
l.p = f
b.p = e
b.s = l
assert g.p.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: F = None
        self.x: B = None
        self.r: D = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: G = None
        self.p: D = None
        self.txt = txt

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

a = A("a")
e = B("e")
i = C("i")
f = D("f")
k = E("k")
c = F("c")
g = G("g")
j = C("j")
l = F("l")
b = G("b")

a.w = l
a.y = c
a.x = e
a.r = f
a.v = k
e.y = f
i.w = c
i.v = f
f.x = a
f.q = b
f.p = i
k.z = e
c.q = b
c.z = g
c.p = f
g.p = e
g.s = c
j.w = c
j.v = f
l.q = g
l.z = b
l.p = f
b.p = e
b.s = l
assert g.p.y.x.txt == "a"