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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: A = None
        self.y: C = None
        self.v: H = None
        self.p: A = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: E = None
        self.w: D = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: G = None
        self.txt = txt

d = A("d")
b = B("b")
c = C("c")
f = D("f")
i = E("i")
j = F("j")
n = G("n")
m = H("m")
l = F("l")

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: A = None
        self.y: C = None
        self.v: H = None
        self.p: A = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: E = None
        self.w: D = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: G = None
        self.txt = txt

d = A("d")
b = B("b")
c = C("c")
f = D("f")
i = E("i")
j = F("j")
n = G("n")
m = H("m")
l = F("l")

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