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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: D = None
        self.p: B = None
        self.z: B = None
        self.t: B = None
        self.y: F = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: D = None
        self.p: B = None
        self.z: B = None
        self.t: B = None
        self.y: F = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

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