class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: B = None
        self.v: C = None
        self.o: D = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: B = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: B = None
        self.t: B = None
        self.u: B = None
        self.s: F = None
        self.x: B = None
        self.q: C = None
        self.txt = txt

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

m.t = n
m.p = h
m.v = g
m.w = g
m.o = a
h.v = g
h.s = g
g.o = h
g.y = h
g.u = j
g.w = j
a.t = j
a.r = j
a.q = h
j.r = g
j.t = a
e.z = g
n.r = g
n.q = g
n.z = h
n.t = h
n.u = h
n.x = h
n.s = e
assert a.q.v.w.t.r.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: B = None
        self.v: C = None
        self.o: D = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: B = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: B = None
        self.t: B = None
        self.u: B = None
        self.s: F = None
        self.x: B = None
        self.q: C = None
        self.txt = txt

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

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