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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: E = None
        self.p: C = None
        self.x: A = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: E = None
        self.o: D = None
        self.q: E = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.x: D = None
        self.txt = txt

n = A("n")
f = B("f")
m = C("m")
g = D("g")
i = E("i")
h = F("h")
b = E("b")
d = D("d")

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: E = None
        self.p: C = None
        self.x: A = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: E = None
        self.o: D = None
        self.q: E = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.x: D = None
        self.txt = txt

n = A("n")
f = B("f")
m = C("m")
g = D("g")
i = E("i")
h = F("h")
b = E("b")
d = D("d")

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