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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: D = None
        self.u: F = None
        self.w: D = None
        self.o: D = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: D = None
        self.z: A = None
        self.x: A = None
        self.txt = txt

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

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

g = A("g")
h = B("h")
e = C("e")
k = D("k")
l = E("l")
f = F("f")
d = D("d")
a = F("a")
j = A("j")
i = E("i")

g.w = a
h.p = g
h.u = l
e.p = j
e.r = d
e.u = f
e.y = f
e.w = k
e.o = k
k.o = h
k.t = d
k.z = j
k.x = j
l.w = g
l.p = d
f.x = g
f.r = d
f.y = h
f.t = h
f.q = e
d.o = h
d.t = k
d.z = j
d.x = j
a.x = g
a.r = k
a.y = h
a.t = h
a.q = e
j.w = a
i.w = g
i.p = d
assert h.p.w.x.w.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: D = None
        self.u: F = None
        self.w: D = None
        self.o: D = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: D = None
        self.z: A = None
        self.x: A = None
        self.txt = txt

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

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

g = A("g")
h = B("h")
e = C("e")
k = D("k")
l = E("l")
f = F("f")
d = D("d")
a = F("a")
j = A("j")
i = E("i")

g.w = a
h.p = g
h.u = l
e.p = j
e.r = d
e.u = f
e.y = f
e.w = k
e.o = k
k.o = h
k.t = d
k.z = j
k.x = j
l.w = g
l.p = d
f.x = g
f.r = d
f.y = h
f.t = h
f.q = e
d.o = h
d.t = k
d.z = j
d.x = j
a.x = g
a.r = k
a.y = h
a.t = h
a.q = e
j.w = a
i.w = g
i.p = d
assert h.p.w.x.w.r.t.txt == "d"