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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: D = None
        self.u: A = None
        self.r: C = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: D = None
        self.u: A = None
        self.r: C = None
        self.q: D = None
        self.txt = txt

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

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

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