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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: C = None
        self.p: E = None
        self.x: B = None
        self.r: B = None
        self.txt = txt

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

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

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

n = A("n")
b = B("b")
g = C("g")
a = D("a")
i = E("i")
m = F("m")
f = G("f")
c = E("c")
l = G("l")
h = E("h")

n.x = f
n.w = a
b.y = a
b.o = m
g.y = a
g.p = l
a.t = m
a.s = g
a.p = c
a.x = b
a.r = b
i.t = a
m.w = n
m.y = g
m.v = a
f.r = n
f.w = i
f.z = i
f.o = c
f.s = m
c.t = a
l.r = n
l.w = h
l.o = h
l.z = c
l.s = m
h.t = a
assert n.w.p.t.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: C = None
        self.p: E = None
        self.x: B = None
        self.r: B = None
        self.txt = txt

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

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

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

n = A("n")
b = B("b")
g = C("g")
a = D("a")
i = E("i")
m = F("m")
f = G("f")
c = E("c")
l = G("l")
h = E("h")

n.x = f
n.w = a
b.y = a
b.o = m
g.y = a
g.p = l
a.t = m
a.s = g
a.p = c
a.x = b
a.r = b
i.t = a
m.w = n
m.y = g
m.v = a
f.r = n
f.w = i
f.z = i
f.o = c
f.s = m
c.t = a
l.r = n
l.w = h
l.o = h
l.z = c
l.s = m
h.t = a
assert n.w.p.t.s.y.txt == "a"