class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: D = None
        self.t: B = None
        self.x: E = None
        self.w: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: C = None
        self.y: C = None
        self.q: C = None
        self.txt = txt

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

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

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

n.z = b
n.u = b
n.t = f
n.x = l
n.w = d
f.p = l
e.u = b
e.y = j
b.y = f
l.t = f
l.z = e
l.y = e
l.q = e
j.w = e
d.s = m
d.p = m
d.v = e
d.z = f
h.s = m
h.p = m
h.v = e
h.z = f
m.t = f
m.z = e
m.y = e
m.q = e
g.s = m
g.v = e
g.p = l
g.z = f
assert n.t.p.t.p.t.p.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: D = None
        self.t: B = None
        self.x: E = None
        self.w: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: C = None
        self.y: C = None
        self.q: C = None
        self.txt = txt

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

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

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

n.z = b
n.u = b
n.t = f
n.x = l
n.w = d
f.p = l
e.u = b
e.y = j
b.y = f
l.t = f
l.z = e
l.y = e
l.q = e
j.w = e
d.s = m
d.p = m
d.v = e
d.z = f
h.s = m
h.p = m
h.v = e
h.z = f
m.t = f
m.z = e
m.y = e
m.q = e
g.s = m
g.v = e
g.p = l
g.z = f
assert n.t.p.t.p.t.p.y.y.txt == "j"