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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: E = None
        self.w: B = None
        self.o: F = None
        self.u: C = None
        self.txt = txt

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

m = A("m")
j = B("j")
h = C("h")
b = D("b")
e = E("e")
l = F("l")
c = E("c")

m.o = b
m.x = b
m.y = e
j.x = e
j.t = b
j.q = b
j.v = m
h.y = b
h.t = b
h.z = l
h.q = l
h.o = m
h.p = j
b.q = m
b.w = m
b.t = j
b.r = e
b.z = h
e.q = m
e.p = c
e.w = j
e.o = l
e.u = h
l.p = c
l.o = m
c.q = m
c.p = e
c.w = j
c.o = l
c.u = h
assert j.x.q.y.o.p.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: E = None
        self.x: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: E = None
        self.w: B = None
        self.o: F = None
        self.u: C = None
        self.txt = txt

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

m = A("m")
j = B("j")
h = C("h")
b = D("b")
e = E("e")
l = F("l")
c = E("c")

m.o = b
m.x = b
m.y = e
j.x = e
j.t = b
j.q = b
j.v = m
h.y = b
h.t = b
h.z = l
h.q = l
h.o = m
h.p = j
b.q = m
b.w = m
b.t = j
b.r = e
b.z = h
e.q = m
e.p = c
e.w = j
e.o = l
e.u = h
l.p = c
l.o = m
c.q = m
c.p = e
c.w = j
c.o = l
c.u = h
assert j.x.q.y.o.p.u.o.txt == "m"