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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: D = None
        self.w: F = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: G = None
        self.o: C = None
        self.s: G = None
        self.txt = txt

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

d = A("d")
c = B("c")
g = C("g")
k = D("k")
j = E("j")
f = F("f")
b = G("b")
h = E("h")
m = G("m")
i = B("i")

d.p = h
d.t = c
c.z = h
c.w = k
c.u = f
g.r = d
k.p = d
k.v = d
k.o = c
k.w = g
k.x = f
k.z = f
k.s = j
j.v = i
j.o = k
j.w = f
j.x = m
f.x = i
f.v = m
f.o = g
f.s = b
b.v = k
b.w = m
b.p = c
h.v = i
h.o = k
h.w = f
h.x = m
m.v = k
m.w = b
m.p = i
i.z = h
i.w = k
i.u = f
assert i.w.w.r.t.u.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: D = None
        self.w: F = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: G = None
        self.o: C = None
        self.s: G = None
        self.txt = txt

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

d = A("d")
c = B("c")
g = C("g")
k = D("k")
j = E("j")
f = F("f")
b = G("b")
h = E("h")
m = G("m")
i = B("i")

d.p = h
d.t = c
c.z = h
c.w = k
c.u = f
g.r = d
k.p = d
k.v = d
k.o = c
k.w = g
k.x = f
k.z = f
k.s = j
j.v = i
j.o = k
j.w = f
j.x = m
f.x = i
f.v = m
f.o = g
f.s = b
b.v = k
b.w = m
b.p = c
h.v = i
h.o = k
h.w = f
h.x = m
m.v = k
m.w = b
m.p = i
i.z = h
i.w = k
i.u = f
assert i.w.w.r.t.u.o.r.txt == "d"