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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: A = None
        self.v: A = None
        self.o: F = None
        self.z: G = None
        self.y: F = None
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: B = None
        self.w: D = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: A = None
        self.v: A = None
        self.o: F = None
        self.z: G = None
        self.y: F = None
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: B = None
        self.w: D = None
        self.r: A = None
        self.txt = txt

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

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

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

b.t = c
b.u = g
b.p = f
b.v = f
g.q = n
a.s = l
a.x = b
a.v = b
a.o = k
a.y = k
a.z = e
a.q = c
f.y = g
f.r = l
f.x = b
f.u = k
n.z = a
n.p = g
n.w = l
n.r = b
k.w = n
k.r = a
k.v = e
c.t = b
c.w = b
l.y = g
l.r = f
l.x = b
l.u = k
e.t = b
e.w = b
assert f.x.t.w.txt == "b"