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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: G = None
        self.q: B = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: B = None
        self.v: B = None
        self.s: F = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: G = None
        self.q: B = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: B = None
        self.v: B = None
        self.s: F = None
        self.p: E = None
        self.txt = txt

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

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