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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: F = None
        self.p: G = None
        self.s: C = None
        self.y: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: H = None
        self.x: E = None
        self.p: A = None
        self.t: E = None
        self.y: G = None
        self.v: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: D = None
        self.x: B = None
        self.w: D = None
        self.u: A = None
        self.txt = txt

b = A("b")
f = B("f")
k = C("k")
d = D("d")
e = E("e")
h = F("h")
g = G("g")
n = H("n")

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: F = None
        self.p: G = None
        self.s: C = None
        self.y: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: H = None
        self.x: E = None
        self.p: A = None
        self.t: E = None
        self.y: G = None
        self.v: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: D = None
        self.x: B = None
        self.w: D = None
        self.u: A = None
        self.txt = txt

b = A("b")
f = B("f")
k = C("k")
d = D("d")
e = E("e")
h = F("h")
g = G("g")
n = H("n")

b.w = k
b.y = d
b.v = d
b.o = d
b.p = g
b.z = f
f.z = k
f.s = k
f.x = h
f.p = g
f.y = g
k.u = n
k.v = d
d.w = h
e.y = d
e.p = d
e.s = k
e.q = k
e.u = g
e.o = f
e.w = f
h.r = b
h.p = b
h.s = n
h.x = e
h.t = e
h.v = e
h.y = g
g.y = h
g.q = k
n.o = f
n.x = f
n.q = d
n.w = d
n.u = b
assert k.v.w.p.z.y.txt == "g"