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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.u: G = None
        self.q: E = None
        self.r: C = None
        self.w: D = None
        self.v: B = None
        self.txt = txt

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

b = A("b")
i = B("i")
m = C("m")
e = D("e")
h = E("h")
l = F("l")
j = G("j")

b.z = m
b.s = i
b.o = i
b.w = l
i.s = m
i.v = b
i.q = h
i.r = e
i.x = l
m.x = h
m.v = e
e.r = j
h.z = b
l.y = h
l.z = h
l.q = h
l.u = j
l.r = m
l.w = e
l.v = i
j.v = b
assert l.v.r.r.v.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: B = None
        self.o: B = None
        self.w: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.u: G = None
        self.q: E = None
        self.r: C = None
        self.w: D = None
        self.v: B = None
        self.txt = txt

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

b = A("b")
i = B("i")
m = C("m")
e = D("e")
h = E("h")
l = F("l")
j = G("j")

b.z = m
b.s = i
b.o = i
b.w = l
i.s = m
i.v = b
i.q = h
i.r = e
i.x = l
m.x = h
m.v = e
e.r = j
h.z = b
l.y = h
l.z = h
l.q = h
l.u = j
l.r = m
l.w = e
l.v = i
j.v = b
assert l.v.r.r.v.s.s.txt == "m"