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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: D = None
        self.t: F = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: G = None
        self.p: G = None
        self.txt = txt

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

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

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

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

b.v = f
b.t = k
b.w = a
b.s = l
c.v = f
c.r = f
c.x = a
c.z = b
k.y = m
k.v = f
k.t = a
k.z = l
f.o = l
f.y = m
f.p = m
l.u = m
l.w = c
l.s = c
l.q = k
l.o = k
l.z = f
a.q = f
a.t = m
m.w = c
assert b.s.u.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: C = None
        self.w: F = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: D = None
        self.t: F = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: G = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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