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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: C = None
        self.q: C = None
        self.v: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

d = A("d")
n = B("n")
b = C("b")
i = D("i")
j = E("j")
a = F("a")
e = B("e")
h = F("h")
g = E("g")

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: C = None
        self.q: C = None
        self.v: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

d = A("d")
n = B("n")
b = C("b")
i = D("i")
j = E("j")
a = F("a")
e = B("e")
h = F("h")
g = E("g")

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