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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: B = None
        self.txt = txt

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

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