class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: G = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: E = None
        self.y: B = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: E = None
        self.y: B = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

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

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

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