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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: B = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: A = None
        self.s: E = None
        self.y: F = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: H = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

j = A("j")
c = B("c")
e = C("e")
g = D("g")
i = E("i")
m = F("m")
n = G("n")
d = H("d")

j.u = e
j.w = e
c.p = e
e.w = i
e.r = c
e.x = g
g.o = d
g.w = j
g.s = i
g.y = m
g.p = m
i.y = j
i.t = m
m.t = g
m.x = d
m.v = c
n.z = d
d.v = m
d.o = i
d.z = j
assert n.z.v.x.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: B = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: A = None
        self.s: E = None
        self.y: F = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: H = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

j = A("j")
c = B("c")
e = C("e")
g = D("g")
i = E("i")
m = F("m")
n = G("n")
d = H("d")

j.u = e
j.w = e
c.p = e
e.w = i
e.r = c
e.x = g
g.o = d
g.w = j
g.s = i
g.y = m
g.p = m
i.y = j
i.t = m
m.t = g
m.x = d
m.v = c
n.z = d
d.v = m
d.o = i
d.z = j
assert n.z.v.x.o.t.txt == "m"