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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.q: B = None
        self.o: C = None
        self.s: F = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.q: B = None
        self.o: C = None
        self.s: F = None
        self.x: A = None
        self.txt = txt

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

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