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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: G = None
        self.z: D = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: F = None
        self.v: F = None
        self.s: A = None
        self.p: B = None
        self.txt = txt

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

b = A("b")
i = B("i")
k = C("k")
l = D("l")
d = E("d")
g = F("g")
h = G("h")
n = C("n")
a = F("a")

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: G = None
        self.z: D = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: F = None
        self.v: F = None
        self.s: A = None
        self.p: B = None
        self.txt = txt

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

b = A("b")
i = B("i")
k = C("k")
l = D("l")
d = E("d")
g = F("g")
h = G("h")
n = C("n")
a = F("a")

b.v = l
b.t = k
b.w = k
b.s = i
b.z = n
i.w = g
i.q = g
i.p = h
i.z = l
i.t = d
k.w = d
k.t = d
l.v = h
d.o = h
g.o = n
g.z = a
g.v = a
g.s = b
g.p = i
h.x = l
h.y = b
h.p = b
h.u = n
n.w = d
n.t = d
a.o = k
a.z = g
a.v = g
a.s = b
a.p = i
assert h.p.s.t.o.p.txt == "b"