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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: C = None
        self.y: D = None
        self.u: A = None
        self.v: A = None
        self.w: D = None
        self.o: A = None
        self.txt = txt

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

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

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

k.v = j
k.z = j
i.p = l
j.v = l
j.z = h
j.p = d
h.q = l
h.z = i
h.y = b
b.z = j
b.s = j
b.y = h
b.w = h
b.u = k
b.v = k
b.o = k
l.u = k
l.x = k
l.q = h
d.z = j
d.x = k
assert b.s.v.q.y.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: C = None
        self.y: D = None
        self.u: A = None
        self.v: A = None
        self.w: D = None
        self.o: A = None
        self.txt = txt

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

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

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

k.v = j
k.z = j
i.p = l
j.v = l
j.z = h
j.p = d
h.q = l
h.z = i
h.y = b
b.z = j
b.s = j
b.y = h
b.w = h
b.u = k
b.v = k
b.o = k
l.u = k
l.x = k
l.q = h
d.z = j
d.x = k
assert b.s.v.q.y.o.v.txt == "j"