class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: C = None
        self.x: G = None
        self.y: B = None
        self.txt = txt

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

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

b.v = d
b.o = g
b.r = g
j.v = a
j.r = d
j.y = d
j.u = g
j.z = h
j.w = k
a.s = d
a.y = j
a.o = g
d.r = b
d.p = b
g.o = a
g.v = a
g.x = b
g.z = k
h.z = i
h.p = a
h.x = k
h.y = j
i.z = j
i.o = j
k.z = j
k.o = j
assert j.v.y.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: C = None
        self.x: G = None
        self.y: B = None
        self.txt = txt

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

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

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