class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: F = None
        self.v: E = None
        self.o: F = None
        self.y: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: C = None
        self.r: C = None
        self.q: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: E = None
        self.s: B = None
        self.w: E = None
        self.y: G = None
        self.u: D = None
        self.txt = txt

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

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

j.x = i
j.t = f
j.o = f
j.v = d
j.y = g
m.z = j
k.o = j
h.v = j
h.w = j
h.r = k
i.y = h
i.w = k
i.r = k
i.q = d
f.p = m
f.s = m
f.x = d
f.w = i
f.y = g
f.u = h
g.w = d
g.p = h
d.y = h
d.w = k
d.r = k
d.q = i
assert f.x.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: F = None
        self.v: E = None
        self.o: F = None
        self.y: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: C = None
        self.r: C = None
        self.q: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: E = None
        self.s: B = None
        self.w: E = None
        self.y: G = None
        self.u: D = None
        self.txt = txt

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

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

j.x = i
j.t = f
j.o = f
j.v = d
j.y = g
m.z = j
k.o = j
h.v = j
h.w = j
h.r = k
i.y = h
i.w = k
i.r = k
i.q = d
f.p = m
f.s = m
f.x = d
f.w = i
f.y = g
f.u = h
g.w = d
g.p = h
d.y = h
d.w = k
d.r = k
d.q = i
assert f.x.q.q.txt == "d"